<?php
/**new
 * Copyright (c) 2003-2012 John Willinsky
 * Ngoc Diep 
 */


import('classes.handler.Handler');
class DMgetHandler extends Handler {
	function DMgetHandler()
	{
	}

	function RFR_DMDV(){
		
		$journal =& Request::getJournal();
		$journalid =$journal->getId();;

		$dmdvdao =& DAORegistry::getDAO('DMDVDAO');
		$dmdv_initial = Request::getUserVar("dmdv_initial");;
		$dmdvString = $dmdvdao->getSetting($journalid, $dmdv_initial);
		echo $dmdvString ;
	}



	function getTen_DMDV(){
		
		$journal =& Request::getJournal();
		$journalid =$journal->getId();;

		$dmdvdao =& DAORegistry::getDAO('DMDVDAO');

		$dmdv_ma = Request::getUserVar("dmdv_madv");
		if (strlen($dmdv_ma)==0)
		{
			echo "";
			return;

		}
		$mysql = "SELECT * FROM dmdv where madv='".$dmdv_ma."'";
		$result = & $dmdvdao->retrieve($mysql);
		$kq = "";
		while (!$result->EOF) {
			$row = $result->GetRowAssoc(false);
			$kq .= $row['tendv']. '---'. $row['masothue']. '---'. $row['diachi'];
			$result->moveNext();
		}
		echo $kq ;
		return;
	}

	function zgetTen_DMVT(){
		$journal =& Request::getJournal();
		$journalid =$journal->getId();;

		$dmvtdao =& DAORegistry::getDAO('DMVTDAO');

		$dmvt_ma = Request::getUserVar("ma");

		if (strlen($dmvt_ma)==0)
		{
			echo "";
			return;

		}
		$dmvt_initial = substr($dmvt_ma,0,1);

		$dmvt_ma .= '</a></b>-';
		$dmvtString = $dmvtdao->getSetting($journalid, $dmvt_initial);
		echo between ($dmvt_ma, '<br><b>', $dmvtString );

	}

	function getTen_DMVT(){
		echo "llll";
		return;
		$dmvtdao =& DAORegistry::getDAO('DMVTDAO');
		$dmvt_ma = Request::getUserVar("ma");
		echo "$dmvt_ma dmvt_ma ";
		return; 
		if (strlen($dmvt_ma)==0)
		{
			echo "";
			return;

		}
		$mysql = "SELECT * FROM dmvt where mavt='".$dmvt_ma."'";
		$result = & $dmvtdao->retrieve($mysql);
		$kq = "";
		while (!$result->EOF) {
			$row = $result->GetRowAssoc(false);
			$kq .= $row['tenvt']. '---'. $row['dvt']. '---'. $row['tk_dt']'---'. $row['tk_ck'];
			$result->moveNext();
		}
		echo $kq ;
		return;
	}



	function getTen_DMTK(){
		$journal =& Request::getJournal();
		$journalid =$journal->getId();;
		$dmtkdao =& DAORegistry::getDAO('DMTKDAO');

		$dmtk_ma = Request::getUserVar("dmtk_matk");
		if (strlen($dmtk_ma)==0)
		{
			echo "";
			return;

		}
		$dmtk_ma .= '</a></b>-';
		$dmtkString = $dmtkdao->getSetting($journalid, 'tracuu');
		echo between ($dmtk_ma, '<br><b>', $dmtkString );

	}
}

?>
